package cn.edu.hbsi.dao;

import cn.edu.hbsi.domain.Person;
import org.apache.ibatis.annotations.One;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;

public interface PersonDao
{
    @Results({
            @Result(id = true,column = "id",property = "id"),
            @Result(column = "name",property = "name"),
            @Result(column = "age",property = "age"),
            @Result(column = "sex",property = "sex"),
            @Result(property = "idCard",column = "card_id",
            one = @One(select = "cn.edu.hbsi.dao.IdCardDao.selectIdCardById"))
    })

    //根据id查找person信息，通过包括IdCard信息
    @Select("select * from tb_person where id=#{id}")
    public Person selectPersonAndIdCard(Integer id);
}
